<template>
  <div>
    wode
  </div>
</template>
<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import { Route } from "vue-router";
@Component({
  beforeRouteEnter(to: Route, from: Route, next: Function): void {
    // ...
    // 前置钩子(没有实例化,不能访问thsi及上下文)与created钩子(已经实例化)区别
    console.log("组件内部-前置守卫");
    next();
  },
  beforeRouteLeave(to: Route, from: Route, next: Function): void {
    // ...
    console.log("组件内部-后置守卫");
    next();
  },
})
export default class extends Vue {
  mounted(): void {
    // console.log("111");
  }
}
</script>
